package elitech.vietnam.myfashion.dialog;

import android.app.Dialog;
import android.content.Context;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.TextView;
import elitech.vietnam.myfashion.R;

public class OkCancelWarnningDialog extends Dialog implements OnClickListener {
	private Dialog mDialog;
	private TextView mTxtWarn;
	private Button mBtnOk, mBtnCancel;
	
	public OkCancelWarnningDialog(Context context, String text) {
		super(context, R.style.Dialog);
		this.mDialog = this;
		setContentView(R.layout.okcanceldialog);
		mTxtWarn = (TextView) findViewById(R.id.warn_txtWarn);
		mBtnOk = (Button) findViewById(R.id.warn_txtOk);
		mBtnCancel = (Button) findViewById(R.id.warn_txtCancel);
		mTxtWarn.setText(text);
		mBtnOk.setOnClickListener(this);
		mBtnCancel.setOnClickListener(this);
	}
	
	public void onOk(){}
	public void onCancel() {}
	
	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.warn_txtOk:
			onOk();
			mDialog.dismiss();
			break;
		case R.id.warn_txtCancel:
			onCancel();
			mDialog.dismiss();
			break;
		}
	}

}
